/*
 * @Copyright: Citylife 2021
 * @Author: WangXinnong
 * @Date: 2020-12-14 12:48:48
 * @Description: ToastManager
 */
import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';

import '../theme/theme_manager.dart';

class ToastManager {
  static showToast({
    String msg = "",
    Toast toastLength = Toast.LENGTH_SHORT,
    int timeInSecForIosWeb = 1,
    double fontSize = 14.0,
    ToastGravity gravity = ToastGravity.CENTER,
    Color backgroundColor,
    Color textColor = Colors.white,
  }) {
    Fluttertoast.showToast(
      msg: msg,
      toastLength: toastLength,
      gravity: gravity,
      timeInSecForIosWeb: timeInSecForIosWeb,
      backgroundColor: backgroundColor ?? theme.colors.toastBackgroundColor,
      textColor: textColor,
      fontSize: fontSize,
    );
  }
}
